Skip to main content

Enrolment Event Technical Design

This a technical design document for the NEMS enrolment event. The target audiences are those working on enrolment publisher applications, enrolment subscriber applications, and NEMS implementation of enrolment events.

Background

The National Enrolment Service (NES) records the relationship of a patient to their provider for a particular health service. Changes to these relationships (“events”) are of interest to organisations and systems in the health sector.

Process view

Enrolment event process view:


flowchart LR
A["NHI/NES Enrolment Change"] --> B("NHI Publisher")
B -- Enrolment Event ---> C["NEMS"]
C -- Enrolment Event --> D["Subscriber1 Connector"] & E["Subscriber2 Connector"] & F["Subscriber3 Connector"]
subgraph x["Subscriber Process"]
y["Subscriber Connector"] --> W\{"Is Relevent"\} -- Yes --> z["Downstream Process"]
W --"No"-->v["Discard"]
end

Enrolment events and event data:


classDiagram
class Enrolment
<<interface>> Enrolment
Enrolment : enrolmentId
Enrolment : NHI
Enrolment : dormantNHIs[]
Enrolment <|.. Created
Enrolment <|.. Ended
Enrolment <|.. Updated
Ended:endReason

Note:

  • An enrolment transfer should result in two enrolment events: an enrolment end event and an enrolment new event.

Topic taxonomy

For enrolment events, the topic taxonomy structure follows the overall topic taxonomy structure:

service-domain/resource/event/verb/version/patient-district/facility-district/pho/enrolling-org/service-type

The topic fields are elaborated in the table below (with dark-green for root taxonomy; light-green for event property)

Enrolment Event Topic FieldField TypeValueDescription
service-domainRootcareadmin“careadmin” is the service domain of enrolment events
resourceRootepisodeofcareAligned with FHIR EpsodeOfCare resource
event categoryRootenrolmentEvent category
verb (past tense)Root[created, ended, updated]Event action, one of the values
versionRootv1Starting version
patient-districtEvent PropertyString value of DHB Code of patient’s physical address from NHIDHB Code of patient’s physical address from NHI
facility-districtEvent PropertyString value of DHB Code of practice’s physical address from HPI LocationDHB Code of practice’s physical address from HPI Location
phoEvent PropertyString value of HPI ORG ID of the Affiliated PHO of the GP Practice (uses PPA table)HPI ORG ID of the Affiliated PHO of the GP Practice
enrolling-orgEvent PropertyString value of organisation ID of the enrolmentOrganisation ID of the enrolment
service-typeEvent Property[“FLS”,”FLS-NF”,”LMC”,”WCTO”]NES Enrolment Type - HIP FHIR Common Terminology Guide v1.8.2 (digital.health.nz)

Message header (Event metadata)

HeaderKey LiteralDescriptionRequiredFormat/ValuesExample
IDsolace-user-property-idMessage id, unique for each publisherGUID correlation ID987298dd-c484-462f-a15d-f18a97267959
Sourcesolace-user-property-sourcePublisher URI referencehttps://uat.nes.digital.health.nz for UAT https://nes.digital.health.nz for prodhttps://uat.nes.digital.health.nz for UAT and https://nes.digital.health.nz for prod
Timesolace-user-property-timeUTC time when the message is publishedYYYY-MM-DDTHH:MM:SS2024-11-30T18:54:43Z
Spec versionversionversion of the CloudEvents specOptional{major}.{minor}1.0
Typesolace-user-property-typesubstring of the topic taxonomy including root to version{root}/{version}careadmin/episodeofcare/enrolment/created/1.0.0
Subjectsolace-user-property-subjectEnrolment ID
Content typesolace-user-property-datacontenttype or content-type for REST APIContent type of event dataapplication/jsonapplication/json

Message payload

Event : Enrolment created

Payload Schema


{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"enrolmentId": {
"type": "string",
"description": "Enrolment ID",
},
"NHI": {
"type": "string",
"description": "NHI ID",
},
"dormantNHIs": {
"type": "array",
"items": {
"type": "string",
},
"description": "Dormant NHI's"
}
},
"additionalProperties": false,
"required": [
"enrolmentId",
"NHI"
]
}

Example


{
"enrolmentId": "xyz1234",
"NHI": "ZGT56KB",
"dormantNHIs": ["ZZZ0008"]
}

Event : Enrolment ended

Payload Schema


{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {
"enrolmentId": {
"type": "string",
"description": "Enrolment ID",
},
"NHI": {
"type": "string",
"description": "NHI ID",
},
"dormantNHIs": {
"type": "array",
"items": {
"type": "string",
},
"description": "Dormant NHI's"
},
"endReason": {
"type": "string",
"description": "Reason of ending enrolment",
"enum": [
"Transfer",
"OptOut",
"Died",
"NotEligible",
"LinkNHI",
"Expire",
"OrgEnd",
"Overseas",
"EnrolledInError"
]
}
},
"additionalProperties": false,
"required": [
"enrolmentId",
"NHI",
"endReason"
]
}

Example


{
"enrolmentId": "xyz1234",
"NHI": "ZGT56KB",
"dormantNHIs": ["ZZZ0008"],
"endReason": "Transfer"
}